import 'package:flutter/material.dart';
import 'package:aweb5/base/BaseWidget.dart';
import 'AddLocation.dart';
class ReceiveAddress extends BaseWidget {
  @override
  State<ReceiveAddress> createState() => ReceiveAddressState();
}

class ReceiveAddressState extends BaseWidgetState<ReceiveAddress> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    init(context);
    return Scaffold(
      backgroundColor: Colors.white,
         appBar: appBarWithBack("收货地址"),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[

          Container(
            color: Color(0xffe9e9e9),
            height: 1,
          ),
          Expanded(
              child: ListView.builder(
                  itemCount: 10,
                  itemBuilder: (con, ind) {
                    return item();
                  })),
          SizedBox(height: 59,)
        ],
      ),
      bottomSheet: Container(
        height: 59,
        child: Column(
          children: <Widget>[
//            Container(
//              height: 1,
//              color: Color(0xffe9e9e9),
//            ),
            Container(
              alignment: Alignment.center,
              color: Colors.white,
              height: 59,
              child: InkWell(
                child: Container(
                  alignment: Alignment.center,
                  width: 149,
                  height: 30,
                  padding:
                  EdgeInsets.only(left: 25, right: 25, top: 3, bottom: 3),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Color(0xffff8900)),
                  child: Text(
                    "新增地址",
                    style: TextStyle(color: Color(0xffffffff), fontSize: 14),
                  ),
                ),
                onTap: (){
                  navigatorState.push(new MaterialPageRoute(builder: (con){
                    return AddLocation();
                  }));
                },
              ),
            )
          ],
        ),
      ),
    );
  }

  Widget item() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Container(
          padding: EdgeInsets.only(left: 10, top: 10, bottom: 10, right: 10),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Row(
                children: <Widget>[
                  Text("陈某某",
                      style: TextStyle(color: Color(0xff2d2d2d), fontSize: 14)),
                  SizedBox(
                    width: 8,
                  ),
                  Text("18787876789",
                      style: TextStyle(color: Color(0xff2d2d2d), fontSize: 14)),
                ],
              ),
              SizedBox(
                height: 15,
              ),
              Text("北京 北京市 平谷区 北京市平谷区紫贵庄园9-10号",
                  style: TextStyle(color: Color(0xff2d2d2d), fontSize: 13)),

            ],
          ),
        ),
        Container(
          height: 1,
          color: Color(0xffe9e9e9),
        ),
        Container(
          padding: EdgeInsets.only(right: 9,bottom: 9),
          child: Row(
            children: <Widget>[
              Checkbox(value: false, onChanged: (v){

              }),
              SizedBox(width: 4,),
              Text("设为默认地址",style: TextStyle(color: Color(0xff2d2d2d),fontSize: 12),),
              Expanded(child: Text("")),
              InkWell(
                child: Container(
                  width: 48,
                  height: 20,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
                      border: Border.all(color: Color(0xffbababa))
                  ),
                  child: Text("删除",style: TextStyle(color: Color(0xff2d2d2d),fontSize: 11),),

                ),

              ),
              SizedBox(width: 11,),
              InkWell(
                child: Container(
                  width: 48,
                  height: 20,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
                      border: Border.all(color: Color(0xffbababa))
                  ),
                  child: Text("编辑",style: TextStyle(color: Color(0xff2d2d2d),fontSize: 11),),

                ),

              )
            ],

          ),
        ),
        Container(height: 10,color: Color(0xfff4f4f4),)
      ],
    );
  }

}